﻿using System;
using System.Html;

namespace enyo
{
    public class WebServiceSender : enyo.Object
    {
        public string handleAs;
        public string method;
        public string url;
        public object headers;
    }

    public class WebServiceRequest : Request
    {
        public string handleAs;
        public string method;
        public string url;
        public object headers;
        public object @params;
        public XmlHttpRequest xhr;
    }

    public delegate void WebServiceHandler(WebServiceSender inSender, object inResponse, WebServiceRequest inRequest);

    public class WebService : enyo.Control
    {
        public string Url { get; set; }
        public void Call(object param)
        {
        }

        public WebServiceHandler onSuccess;
        public WebServiceHandler onFailure;
    }

    [NonScript]
    public static class WebServiceExt
    {
        public static WebServiceHandler Bind(this WebServiceHandler h, object target)
        {
            return null;
        }
    }
}
